
Zepto(function ($) {
	
    //输入框变化更新到某个位置
	$(document).on("change", "input[data-role='RTUpdate']", function () {
	    var $this = $(this);
	    var tar = $this.data("target");
	    var formTar = $this.data("formtar");
	    //显示的note可选default,input框则不需要啦
	    var $tar = $(tar);
	    var sVal = this.value || $tar.data("textdef") || this.value;
	    $tar.html(sVal);
	    $(formTar).val(this.value);
	});
    //列表选择然后更新到某位置
	$(document).on("click", "ul[data-role='RTUpdate']", function (e) {
	    if (e.target.nodeName !== "LI") { return; }
	    var $this = $(this);
	    var tar = $this.data("target");
	    var formTar = $this.data("formtar");
	    var sVal = e.target.innerHTML;
	    $(tar).html(sVal);
	    $(formTar).val(sVal);

	    //做更多的动作:
	    var domore = tar = $this.data("call");
	    switch (domore) {
	        case "closethis":
	            $this.parents(".box-round-green").find("a[data-toggle='collapse']").trigger("click");
	            return;
	        default:
	            return;
	    }

	});
	$(document).on("click", "[data-role='RTClear']", function () {

	    var $this = $(this);
	    var formTar = $this.data("formtar");
	    $(formTar).find("input").each(function (i, item) {
	        var $item = $(item);
	        $item.val("");
	        $item.trigger("change");
	    })

	});

    //因为输入软件挡住了input
	$(document).on("focus", "[data-focus='scrollbot']", function () {
	    var $this = $(this);
	    $this.parents(".navDrawer-content")[0].scrollTop = 500;//500是随意

	});
	$(document).on("blur", "[data-focus='scrollbot']", function () {
	    var $this = $(this);
	    $this.parents(".navDrawer-content")[0].scrollTop = 0;

	});

});

